package first.group.ssh.channel;

import java.io.IOException;
import java.nio.ByteBuffer;

public abstract class ChannelRequest {

    public final boolean wantReply;

    public ChannelRequest() {
        this(false);
    }

    public ChannelRequest(boolean wantReply) {
        this.wantReply = wantReply;
    }

    public abstract String getName();

    public abstract void write(ByteBuffer buffer);
    
    public abstract static class Parser<T extends ChannelRequest> {
        
        public abstract T parse(ByteBuffer buffer) throws IOException;
    }
}
